package extend2;
/*
    为什么静态方法运行也看左边;
    静态属于类,就应该用类名直接调用
 */

public class Demo1 {
    public static void main(String[] args) {
        Son son = new Son();
        son.methodZi();//methodZi
        son.methodFu();//methodFu
        son.method();//子类的method
        Son.methodZi();//methodZi
        Son.methodFu();//methodFu
        Son.method();//子类的method
        System.out.println("-------------");
        Father f = new Son();
        //f.methodZi();//
        f.methodFu();//methodFu
        f.method();//父类的method

        Father.methodFu();//methodFu
        Father.method();//父类的method
    }
}


class Father{
    public static void methodFu(){
        System.out.println("methodFu");
    }

    public static void method(){
        System.out.println("父类的method");
    }
}

class Son extends Father{
    public static void methodZi(){
        System.out.println("methodZi");
    }

    //@Override
    public static void method(){
        System.out.println("子类的method");
    }
}
